<?php

class model_menu extends model_version{

	protected  $item_model;
	public function __construct() {
		parent::__construct();
	}
	public function model_version_delete_byPk($pk, $insertLog = false, $deleteRelativeRecords = false) {
		if ($deleteRelativeRecords) {
			
			$exist_data = $this->get ( $pk );
			//delete menu item list data

			$menu_item_db_obj = spClass ( $this->item_model );
			$menu_item_list_data = $menu_item_db_obj->findAll ( array ('parent_uuid' => $exist_data ['uuid'] ) );
			foreach ( $menu_item_list_data as $menu_item ) {
				$menu_item_db_obj->model_version_delete_byPk ( $menu_item [$menu_item_db_obj->pk], $insertLog, $deleteRelativeRecords );
			}
		}
		parent::model_version_delete_byPk ( $pk, $insertLog );
	}
}

?>